/* Copyright (C) 2009 Alvaro Morais <alvaromorais@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 */

#include <config.h>
#include "main.h"
#include "curseswindow.h"
#include "bforcer.h"
#include "bforcer_exception.h"
#include <stdlib.h>
#include <iostream>
#include <exception>
#include <pcrecpp.h>
#include <string>

using namespace std;



int main(int argc, char** argv)
{

#if 0
    string contents = "Hello my friend";
    pcrecpp::StringPiece input(contents);
    string var;

    pcrecpp::RE re("(e)");
    while (re.FindAndConsume(&input, &var))
    {
        cout << var << endl;
    }

#else
    try {
        BForcer c;
        c.setFromArgs(argc, argv);
        c.startBruteForce();
    } catch(Bforcer_badopt_error& e)
    {
        cerr << " -User Options Error:\n" << e.what() << endl;

    } catch (BForcer_code_error& e)
    {
        cerr << " -Code error:\n" << e.what() << endl;        
    } catch (BForcer_runtime_error& e)
    {
        cerr << " -Runtime error:\n" << e.what() << endl;
    }

#ifdef DEV_DEBUG
    cerr << "The program is going to exit successfully.\n";
#endif
#endif
    return 0;
}


